package 标准代码;

import java.io.*;

/**
 * Created by 5406160@qq.com on LiBoWen 李博闻.
 *
 * @ClassName : 高效字节流一次一个字节数组复制文件
 * @Author : 54061
 * @Date: 2022/2/14 9:26
 */
public class 高效字节流一次一个字节数组复制文件 {
    public static void main(String[] args) throws IOException {
        long start = System.currentTimeMillis();

        //创建流
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(""));

        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(""));


        //循环读写
        byte[] bys = new byte[1024];
        int len;
        while ((len = bis.read(bys)) !=-1){
            //写出去
            bos.write(bys,0,len);
        }
        bis.close();
        bos.close();

        long end = System.currentTimeMillis();
        System.out.println( end-start);

    }
}
